package com.example.duanjunjie.learn.sync;

/**
 * Created by duanjunjie on 2018/3/7.
 */

public class SyncTest {
    private static SyncTest syncTest=new SyncTest();
    public static SyncTest getInstance(){
        return syncTest;
    }

    public void start1(){
        synchronized (this){
            for (int i=0;i<10;i++){
                System.out.println("start1:"+i);
            }
        }
    }
    public void start2(){
        synchronized (this){
            for (int i=0;i<10;i++){
                System.out.println("start2:"+i);
            }
        }
    }
}
